﻿@using ExampleWebApplication.Controllers
@using ExampleWebApplication.Entities
@using ExampleWebApplication.Properties
<h2>
    @EntityFrameworkStrings.Example8d4
</h2>
@(Html.Telerik().Grid<Supplier>().Name("Grid")
        .Columns(columns =>
        {
            columns.Bound(d => d.SupplierID)
                .Width(80)
                .Aggregate(aggregates => aggregates.Sum())
                .ClientGroupFooterTemplate("Custom: <#= Custom #> <br/> Sum: <#= Sum #>")
                .ClientFooterTemplate("Custom: <#= Custom #> <br/> Sum: <#= Sum #>");
            
            columns.Bound(d => d.ContactTitle);
            columns.Bound(o => o.ContactName);
            columns.Bound(d => d.Address);
            columns.Bound(d => d.City);
            columns.Bound(d => d.PostalCode);
            columns.Bound(d => d.Country);
        })
        .EnableCustomBinding(true).Sortable().Filterable().Pageable()
        .DataBinding(dataBinding => dataBinding.Ajax().Select<EntityFrameworkController>(ctr => ctr.CustomAggregatesFunctionsInlineDirectUsageOfTEntityClientSideData(null)))
        .Groupable(settings => settings.Groups(groups => groups.Add(o => o.ContactTitle)).Visible(false)))
